<?php
require_once 'Junction/Db/Exception.php';
require_once 'Junction/Db/Adapter.php';

interface Junction_Db_Service {
	
	/**
	 * @throws Junction_Db_Exception
	 * @param Junction_Db_Adapter $adapter
	 */
	public function connect(Junction_Db_Adapter $adapter);
	
	/**
	 * @throws Junction_Db_Exception
	 * @param String $query
	 * @param array $params
	 * @return boolean
	 */
	public function save($query, array $params = null);
	
	/**
	 * @throws Junction_Db_Exception
	 * @param String $query
	 * @param array $params
	 * @return array
	 */
	public function select($query, array $params = null);
	
	/**
	 * @return int
	 */
	public function lastInsertId();
	
	/**
	 * @return int
	 */
	public function affectedRows();
}
?>